<extend name="./main"/>
<block name="title">
    <title>qzone后台----日志管理</title>
</block>
<block name="main">
<script src="__PUBLIC__/js/jquery.min.js"></script>
<div class="col-md-12">
    <section class="panel">
        <div class="panel-body">
            <center><h2>日志管理</h2></center>
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="{:U('index')}">审核日志</a>
                </li>
                <li class="">
                    <a href="{:U('delete')}">被删除的日志</a>
                </li>
            </ul>
            
            <table class="table  table-hover general-table mt30" id="loglist">
                <thead>
                <tr>
                    <th>用户ID</th>
                    <th class="hidden-phone">日志标题</th>
                    <th>发表时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="logList" id="vo">
                <tr class="logitem">
                    <td><a href="#">{$vo.uid}</a></td>
                    <td><a href="{:U('detail',array('id'=>$vo['id']))}">{$vo.title}</a></td>
                    <td>{$vo.ctime|date="Y-m-d H:i:s",###} </td>
                    <td><button class="label label-warning label-mini act-del" dataid="{$vo.id}">删除</button></td>
                </tr>
                </volist>
                </tbody>
            </table>
        </div>
    </section>
</div>
<script>
    $('#loglist').on('click','.act-del',function(){
        // debugger;
        var self = $(this);
        var id = self.attr('dataid');
        $.ajax({
            type:'POST',
            url:'{:U("del")}',
            data:{'id':id},
            datatype:'json',
            success:function(rs){
                if(rs.status == 'success'){
                    self.parents('tr.logitem').remove();
                }else{
                    alert(rs.msg);
                }
            }
        });
    });
</script>
</block>